import { User } from '@/business/user/entities/user.entity';
import { ApiProperty } from '@nestjs/swagger';
import { IsArray, IsNotEmpty, IsNumber, IsOptional } from 'class-validator';

export class CreateAdventureDto {
  @ApiProperty({ description: '工会名称', example: '疾风小队' })
  @IsNotEmpty({ message: '工会名称不能为空' })
  name: string;

  @ApiProperty({ description: '工会描述', example: '疾风小队的描述' })
  desc: string;

  @ApiProperty({ description: '成员数量', example: 1 })
  @IsNumber()
  memberNum: number;

  @ApiProperty({ description: '等级', example: 1 })
  @IsNumber(undefined, { message: '等级为数字' })
  level: number;

  @ApiProperty({ description: '称号', example: '无往不利' })
  @IsOptional()
  title: string;
  @ApiProperty({ description: '工会成员', example: [{ id: 1 }] })
  @IsArray({ message: '工会成员只能是数组格式' })
  @IsOptional()
  members: User[];
}
